package com.chujian.framework.util;

import org.apache.commons.lang3.StringUtils;

import java.io.Serializable;
import java.util.List;
import java.util.stream.Collectors;

public class JoinShowUs {

    public static String joinInfos(Serializable id, List<String> parts) {
        String info = parts.stream()
                .filter(StringUtils::isNotEmpty)
                .collect(Collectors.joining(","));
        return "[" + id + "] " + info;
    }

    public static String joinLbVal(String lb, String value) {
        if (StringUtils.isEmpty(value)) {
            return null;
        }
        return lb + ":" + value;
    }

}
